<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 702
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 710
</span><span class="hs-pragma">{-# LANGUAGE AutoDeriveTypeable #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Module      :  Control.Monad.Trans.RWS.Lazy</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Copyright   :  (c) Andy Gill 2001,</span><span>
</span><span id="line-12"></span><span class="hs-comment">--                (c) Oregon Graduate Institute of Science and Technology, 2001</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Maintainer  :  R.Paterson@city.ac.uk</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- A monad transformer that combines 'ReaderT', 'WriterT' and 'StateT'.</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- This version is lazy; for a constant-space version with almost the</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- same interface, see &quot;Control.Monad.Trans.RWS.CPS&quot;.</span><span>
</span><span id="line-22"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Trans.RWS.Lazy</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-25"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The RWS monad</span></span><span>
</span><span id="line-26"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier">RWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#rws"><span class="hs-identifier">rws</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-identifier">runRWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWS"><span class="hs-identifier">evalRWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWS"><span class="hs-identifier">execRWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWS"><span class="hs-identifier">mapRWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWS"><span class="hs-identifier">withRWS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The RWST monad transformer</span></span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier">RWST</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWST"><span class="hs-identifier">evalRWST</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWST"><span class="hs-identifier">execRWST</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWST"><span class="hs-identifier">mapRWST</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWST"><span class="hs-identifier">withRWST</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Reader operations</span></span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-identifier">reader</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-identifier">ask</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-identifier">local</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#asks"><span class="hs-identifier">asks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Writer operations</span></span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#writer"><span class="hs-identifier">writer</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#tell"><span class="hs-identifier">tell</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listen"><span class="hs-identifier">listen</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listens"><span class="hs-identifier">listens</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#pass"><span class="hs-identifier">pass</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#censor"><span class="hs-identifier">censor</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>    </span><span class="annot"><span class="hs-comment">-- * State operations</span></span><span>
</span><span id="line-52"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#state"><span class="hs-identifier">state</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#get"><span class="hs-identifier">get</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#put"><span class="hs-identifier">put</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#modify"><span class="hs-identifier">modify</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#gets"><span class="hs-identifier">gets</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Lifting other operations</span></span><span>
</span><span id="line-58"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC"><span class="hs-identifier">liftCallCC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC%27"><span class="hs-identifier">liftCallCC'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCatch"><span class="hs-identifier">liftCatch</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#"><span class="hs-identifier">Control.Monad.IO.Class</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html"><span class="hs-identifier">Control.Monad.Signatures</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Class.html"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,12,0)
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#"><span class="hs-identifier">Data.Functor.Contravariant</span></a></span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#"><span class="hs-identifier">Data.Functor.Identity</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,9,0)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Fail</span></span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#"><span class="hs-identifier">Control.Monad.Fix</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-comment">-- | A monad containing an environment of type @r@, output of type @w@</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- and an updatable state of type @s@.</span><span>
</span><span id="line-81"></span><span class="hs-keyword">type</span><span> </span><span id="RWS"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-var">RWS</span></a></span></span><span> </span><span id="local-6989586621679078818"><span class="annot"><a href="#local-6989586621679078818"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span id="local-6989586621679078817"><span class="annot"><a href="#local-6989586621679078817"><span class="hs-identifier hs-type">w</span></a></span></span><span> </span><span id="local-6989586621679078816"><span class="annot"><a href="#local-6989586621679078816"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078818"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078817"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078816"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | Construct an RWS computation from a function.</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- (The inverse of 'runRWS'.)</span><span>
</span><span id="line-85"></span><span id="local-6989586621679079289"><span id="local-6989586621679079290"><span id="local-6989586621679079291"><span id="local-6989586621679079292"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#rws"><span class="hs-identifier hs-type">rws</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079292"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079291"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079290"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079291"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079289"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079292"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079289"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079291"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079290"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-86"></span><span id="rws"><span class="annot"><span class="annottext">rws :: forall r s a w. (r -&gt; s -&gt; (a, s, w)) -&gt; RWS r w s a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#rws"><span class="hs-identifier hs-var hs-var">rws</span></a></span></span><span> </span><span id="local-6989586621679078815"><span class="annot"><span class="annottext">r -&gt; s -&gt; (a, s, w)
</span><a href="#local-6989586621679078815"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; Identity (a, s, w)) -&gt; RWST r w s Identity a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078813"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078813"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078812"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078812"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; Identity (a, s, w)
forall a. a -&gt; Identity a
</span><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-var">Identity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; s -&gt; (a, s, w)
</span><a href="#local-6989586621679078815"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078813"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078812"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#rws"><span class="hs-pragma hs-type">rws</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | Unwrap an RWS computation as a function.</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- (The inverse of 'rws'.)</span><span>
</span><span id="line-91"></span><span id="local-6989586621679079273"><span id="local-6989586621679079274"><span id="local-6989586621679079275"><span id="local-6989586621679079276"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-identifier hs-type">runRWS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079276"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079275"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079274"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079273"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079276"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079274"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079273"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079274"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079275"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-92"></span><span id="runRWS"><span class="annot"><span class="annottext">runRWS :: forall r w s a. RWS r w s a -&gt; r -&gt; s -&gt; (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-identifier hs-var hs-var">runRWS</span></a></span></span><span> </span><span id="local-6989586621679078810"><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078810"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078809"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078809"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078808"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078808"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Identity (a, s, w) -&gt; (a, s, w)
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWS r w s a -&gt; r -&gt; s -&gt; Identity (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078810"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078809"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078808"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-pragma hs-type">runRWS</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Evaluate a computation with the given initial state and environment,</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- returning the final value and output, discarding the final state.</span><span>
</span><span id="line-97"></span><span id="local-6989586621679079264"><span id="local-6989586621679079265"><span id="local-6989586621679079266"><span id="local-6989586621679079267"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWS"><span class="hs-identifier hs-type">evalRWS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079267"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079266"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079265"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079264"><span class="hs-identifier hs-type">a</span></a></span><span>  </span><span class="hs-comment">-- ^RWS computation to execute</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079267"><span class="hs-identifier hs-type">r</span></a></span><span>            </span><span class="hs-comment">-- ^initial environment</span><span>
</span><span id="line-99"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079265"><span class="hs-identifier hs-type">s</span></a></span><span>            </span><span class="hs-comment">-- ^initial value</span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079264"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079266"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span><span>       </span><span class="hs-comment">-- ^final value and output</span><span>
</span><span id="line-101"></span><span id="evalRWS"><span class="annot"><span class="annottext">evalRWS :: forall r w s a. RWS r w s a -&gt; r -&gt; s -&gt; (a, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWS"><span class="hs-identifier hs-var hs-var">evalRWS</span></a></span></span><span> </span><span id="local-6989586621679078805"><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078805"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078804"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078804"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078803"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078803"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679078802"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078802"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078801"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078801"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWS r w s a -&gt; r -&gt; s -&gt; (a, s, w)
forall r w s a. RWS r w s a -&gt; r -&gt; s -&gt; (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-identifier hs-var">runRWS</span></a></span><span> </span><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078805"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078804"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078803"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078802"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078801"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWS"><span class="hs-pragma hs-type">evalRWS</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-comment">-- | Evaluate a computation with the given initial state and environment,</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- returning the final state and output, discarding the final value.</span><span>
</span><span id="line-108"></span><span id="local-6989586621679079256"><span id="local-6989586621679079257"><span id="local-6989586621679079258"><span id="local-6989586621679079259"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWS"><span class="hs-identifier hs-type">execRWS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079259"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079258"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079257"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079256"><span class="hs-identifier hs-type">a</span></a></span><span>  </span><span class="hs-comment">-- ^RWS computation to execute</span><span>
</span><span id="line-109"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079259"><span class="hs-identifier hs-type">r</span></a></span><span>            </span><span class="hs-comment">-- ^initial environment</span><span>
</span><span id="line-110"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079257"><span class="hs-identifier hs-type">s</span></a></span><span>            </span><span class="hs-comment">-- ^initial value</span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079257"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079258"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span><span>       </span><span class="hs-comment">-- ^final state and output</span><span>
</span><span id="line-112"></span><span id="execRWS"><span class="annot"><span class="annottext">execRWS :: forall r w s a. RWS r w s a -&gt; r -&gt; s -&gt; (s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#execRWS"><span class="hs-identifier hs-var hs-var">execRWS</span></a></span></span><span> </span><span id="local-6989586621679078800"><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078800"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078799"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078799"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078798"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078798"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078797"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078797"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078796"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078796"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWS r w s a -&gt; r -&gt; s -&gt; (a, s, w)
forall r w s a. RWS r w s a -&gt; r -&gt; s -&gt; (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWS"><span class="hs-identifier hs-var">runRWS</span></a></span><span> </span><span class="annot"><span class="annottext">RWS r w s a
</span><a href="#local-6989586621679078800"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078799"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078798"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078797"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078796"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWS"><span class="hs-pragma hs-type">execRWS</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-comment">-- | Map the return value, final state and output of a computation using</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- the given function.</span><span>
</span><span id="line-119"></span><span class="hs-comment">--</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- * @'runRWS' ('mapRWS' f m) r s = f ('runRWS' m r s)@</span><span>
</span><span id="line-121"></span><span id="local-6989586621679079246"><span id="local-6989586621679079247"><span id="local-6989586621679079248"><span id="local-6989586621679079249"><span id="local-6989586621679079250"><span id="local-6989586621679079251"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWS"><span class="hs-identifier hs-type">mapRWS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079251"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079250"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079249"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079248"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079250"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079247"><span class="hs-identifier hs-type">w'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079246"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079249"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079250"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079251"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079246"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079247"><span class="hs-identifier hs-type">w'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079250"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079248"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-122"></span><span id="mapRWS"><span class="annot"><span class="annottext">mapRWS :: forall a s w b w' r.
((a, s, w) -&gt; (b, s, w')) -&gt; RWS r w s a -&gt; RWS r w' s b
</span><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWS"><span class="hs-identifier hs-var hs-var">mapRWS</span></a></span></span><span> </span><span id="local-6989586621679078795"><span class="annot"><span class="annottext">(a, s, w) -&gt; (b, s, w')
</span><a href="#local-6989586621679078795"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Identity (a, s, w) -&gt; Identity (b, s, w'))
-&gt; RWST r w s Identity a -&gt; RWST r w' s Identity b
forall (m :: * -&gt; *) a s w (n :: * -&gt; *) b w' r.
(m (a, s, w) -&gt; n (b, s, w')) -&gt; RWST r w s m a -&gt; RWST r w' s n b
</span><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWST"><span class="hs-identifier hs-var">mapRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b, s, w') -&gt; Identity (b, s, w')
forall a. a -&gt; Identity a
</span><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-var">Identity</span></a></span><span> </span><span class="annot"><span class="annottext">((b, s, w') -&gt; Identity (b, s, w'))
-&gt; (Identity (a, s, w) -&gt; (b, s, w'))
-&gt; Identity (a, s, w)
-&gt; Identity (b, s, w')
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; (b, s, w')
</span><a href="#local-6989586621679078795"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">((a, s, w) -&gt; (b, s, w'))
-&gt; (Identity (a, s, w) -&gt; (a, s, w))
-&gt; Identity (a, s, w)
-&gt; (b, s, w')
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Identity (a, s, w) -&gt; (a, s, w)
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWS"><span class="hs-pragma hs-type">mapRWS</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | @'withRWS' f m@ executes action @m@ with an initial environment</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- and state modified by applying @f@.</span><span>
</span><span id="line-127"></span><span class="hs-comment">--</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- * @'runRWS' ('withRWS' f m) r s = 'uncurry' ('runRWS' m) (f r s)@</span><span>
</span><span id="line-129"></span><span id="local-6989586621679079224"><span id="local-6989586621679079225"><span id="local-6989586621679079226"><span id="local-6989586621679079227"><span id="local-6989586621679079228"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWS"><span class="hs-identifier hs-type">withRWS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079228"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079227"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079226"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079227"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079226"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079225"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079227"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079224"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWS"><span class="hs-identifier hs-type">RWS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079228"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079225"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079227"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079224"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-130"></span><span id="withRWS"><span class="annot"><span class="annottext">withRWS :: forall r' s r w a.
(r' -&gt; s -&gt; (r, s)) -&gt; RWS r w s a -&gt; RWS r' w s a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#withRWS"><span class="hs-identifier hs-var hs-var">withRWS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r' -&gt; s -&gt; (r, s))
-&gt; RWST r w s Identity a -&gt; RWST r' w s Identity a
forall r' s r w (m :: * -&gt; *) a.
(r' -&gt; s -&gt; (r, s)) -&gt; RWST r w s m a -&gt; RWST r' w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#withRWST"><span class="hs-identifier hs-var">withRWST</span></a></span><span>
</span><span id="line-131"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWS"><span class="hs-pragma hs-type">withRWS</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- | A monad transformer adding reading an environment of type @r@,</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- collecting an output of type @w@ and updating a state of type @s@</span><span>
</span><span id="line-136"></span><span class="hs-comment">-- to an inner monad @m@.</span><span>
</span><span id="line-137"></span><span class="hs-keyword">newtype</span><span> </span><span id="RWST"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span></span><span> </span><span id="local-6989586621679079282"><span class="annot"><a href="#local-6989586621679079282"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span id="local-6989586621679079278"><span class="annot"><a href="#local-6989586621679079278"><span class="hs-identifier hs-type">w</span></a></span></span><span> </span><span id="local-6989586621679079281"><span class="annot"><a href="#local-6989586621679079281"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679079280"><span class="annot"><a href="#local-6989586621679079280"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679079279"><span class="annot"><a href="#local-6989586621679079279"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="RWST"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runRWST"><span class="annot"><span class="annottext">forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679079282"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079281"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079280"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079279"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079281"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079278"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-- | Evaluate a computation with the given initial state and environment,</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- returning the final value and output, discarding the final state.</span><span>
</span><span id="line-141"></span><span id="local-6989586621679079203"><span id="local-6989586621679079204"><span id="local-6989586621679079205"><span id="local-6989586621679079206"><span id="local-6989586621679079207"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWST"><span class="hs-identifier hs-type">evalRWST</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079207"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>         </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079206"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079205"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079204"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079207"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079203"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span class="hs-comment">-- ^computation to execute</span><span>
</span><span id="line-143"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079206"><span class="hs-identifier hs-type">r</span></a></span><span>                   </span><span class="hs-comment">-- ^initial environment</span><span>
</span><span id="line-144"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079204"><span class="hs-identifier hs-type">s</span></a></span><span>                   </span><span class="hs-comment">-- ^initial value</span><span>
</span><span id="line-145"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079207"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079203"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079205"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>            </span><span class="hs-comment">-- ^computation yielding final value and output</span><span>
</span><span id="line-146"></span><span id="evalRWST"><span class="annot"><span class="annottext">evalRWST :: forall (m :: * -&gt; *) r w s a.
Monad m =&gt;
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWST"><span class="hs-identifier hs-var hs-var">evalRWST</span></a></span></span><span> </span><span id="local-6989586621679078790"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078790"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078789"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078789"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078788"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078788"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078787"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078787"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078786"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078786"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078790"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078789"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078788"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-148"></span><span>    </span><span class="annot"><span class="annottext">(a, w) -&gt; m (a, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078787"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078786"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#evalRWST"><span class="hs-pragma hs-type">evalRWST</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">-- | Evaluate a computation with the given initial state and environment,</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- returning the final state and output, discarding the final value.</span><span>
</span><span id="line-153"></span><span id="local-6989586621679079191"><span id="local-6989586621679079192"><span id="local-6989586621679079193"><span id="local-6989586621679079194"><span id="local-6989586621679079195"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWST"><span class="hs-identifier hs-type">execRWST</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079195"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>         </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079194"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079193"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079192"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079195"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079191"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span class="hs-comment">-- ^computation to execute</span><span>
</span><span id="line-155"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079194"><span class="hs-identifier hs-type">r</span></a></span><span>                   </span><span class="hs-comment">-- ^initial environment</span><span>
</span><span id="line-156"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079192"><span class="hs-identifier hs-type">s</span></a></span><span>                   </span><span class="hs-comment">-- ^initial value</span><span>
</span><span id="line-157"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079195"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079192"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079193"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>            </span><span class="hs-comment">-- ^computation yielding final state and output</span><span>
</span><span id="line-158"></span><span id="execRWST"><span class="annot"><span class="annottext">execRWST :: forall (m :: * -&gt; *) r w s a.
Monad m =&gt;
RWST r w s m a -&gt; r -&gt; s -&gt; m (s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#execRWST"><span class="hs-identifier hs-var hs-var">execRWST</span></a></span></span><span> </span><span id="local-6989586621679078782"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078782"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078781"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078781"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078780"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078780"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-159"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078779"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078779"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078778"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078778"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078782"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078781"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078780"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-160"></span><span>    </span><span class="annot"><span class="annottext">(s, w) -&gt; m (s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078779"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078778"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#execRWST"><span class="hs-pragma hs-type">execRWST</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="hs-comment">-- | Map the inner computation using the given function.</span><span>
</span><span id="line-164"></span><span class="hs-comment">--</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- * @'runRWST' ('mapRWST' f m) r s = f ('runRWST' m r s)@</span><span>
</span><span id="line-166"></span><span id="local-6989586621679079232"><span id="local-6989586621679079233"><span id="local-6989586621679079234"><span id="local-6989586621679079235"><span id="local-6989586621679079236"><span id="local-6989586621679079237"><span id="local-6989586621679079238"><span id="local-6989586621679079239"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWST"><span class="hs-identifier hs-type">mapRWST</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079239"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079238"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079237"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079236"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079235"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079234"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079237"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079233"><span class="hs-identifier hs-type">w'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079232"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079236"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079237"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079239"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079238"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079232"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079233"><span class="hs-identifier hs-type">w'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079237"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079235"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079234"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span></span></span></span><span>
</span><span id="line-167"></span><span id="mapRWST"><span class="annot"><span class="annottext">mapRWST :: forall (m :: * -&gt; *) a s w (n :: * -&gt; *) b w' r.
(m (a, s, w) -&gt; n (b, s, w')) -&gt; RWST r w s m a -&gt; RWST r w' s n b
</span><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWST"><span class="hs-identifier hs-var hs-var">mapRWST</span></a></span></span><span> </span><span id="local-6989586621679078777"><span class="annot"><span class="annottext">m (a, s, w) -&gt; n (b, s, w')
</span><a href="#local-6989586621679078777"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078776"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078776"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; n (b, s, w')) -&gt; RWST r w' s n b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; n (b, s, w')) -&gt; RWST r w' s n b)
-&gt; (r -&gt; s -&gt; n (b, s, w')) -&gt; RWST r w' s n b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078775"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078775"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078774"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078774"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; n (b, s, w')
</span><a href="#local-6989586621679078777"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078776"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078775"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078774"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#mapRWST"><span class="hs-pragma hs-type">mapRWST</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | @'withRWST' f m@ executes action @m@ with an initial environment</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- and state modified by applying @f@.</span><span>
</span><span id="line-172"></span><span class="hs-comment">--</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- * @'runRWST' ('withRWST' f m) r s = 'uncurry' ('runRWST' m) (f r s)@</span><span>
</span><span id="line-174"></span><span id="local-6989586621679079213"><span id="local-6989586621679079214"><span id="local-6989586621679079215"><span id="local-6989586621679079216"><span id="local-6989586621679079217"><span id="local-6989586621679079218"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWST"><span class="hs-identifier hs-type">withRWST</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079218"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079217"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079216"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079217"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079216"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079215"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079217"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079214"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079213"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079218"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079215"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079217"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079214"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079213"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-175"></span><span id="withRWST"><span class="annot"><span class="annottext">withRWST :: forall r' s r w (m :: * -&gt; *) a.
(r' -&gt; s -&gt; (r, s)) -&gt; RWST r w s m a -&gt; RWST r' w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#withRWST"><span class="hs-identifier hs-var hs-var">withRWST</span></a></span></span><span> </span><span id="local-6989586621679078773"><span class="annot"><span class="annottext">r' -&gt; s -&gt; (r, s)
</span><a href="#local-6989586621679078773"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078772"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078772"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r' -&gt; s -&gt; m (a, s, w)) -&gt; RWST r' w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r' -&gt; s -&gt; m (a, s, w)) -&gt; RWST r' w s m a)
-&gt; (r' -&gt; s -&gt; m (a, s, w)) -&gt; RWST r' w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078771"><span class="annot"><span class="annottext">r'
</span><a href="#local-6989586621679078771"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078770"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078770"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; (r, s) -&gt; m (a, s, w)
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078772"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r' -&gt; s -&gt; (r, s)
</span><a href="#local-6989586621679078773"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r'
</span><a href="#local-6989586621679078771"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078770"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#withRWST"><span class="hs-pragma hs-type">withRWST</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span id="local-6989586621679079157"><span id="local-6989586621679079158"><span id="local-6989586621679079159"><span id="local-6989586621679079160"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679078766"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079160"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079159"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079158"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079157"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079160"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621679078763"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; RWST r w s m a -&gt; RWST r w s m b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679078762"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679078762"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078761"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078761"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078760"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078760"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078759"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078759"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-180"></span><span>        </span><span class="annot"><span class="annottext">((a, s, w) -&gt; (b, s, w)) -&gt; m (a, s, w) -&gt; m (b, s, w)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078758"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078758"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078757"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078757"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078756"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078756"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679078762"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078758"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078757"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078756"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (b, s, w)) -&gt; m (a, s, w) -&gt; m (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078761"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078760"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078759"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-pragma hs-type">fmap</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span id="local-6989586621679079140"><span id="local-6989586621679079141"><span id="local-6989586621679079142"><span id="local-6989586621679079143"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679078746"><span id="local-6989586621679078748"><span id="local-6989586621679078750"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079143"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079142"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079142"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079141"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079143"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079140"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079142"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-184"></span><span>    </span><span id="local-6989586621679078742"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; RWST r w s m a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679078741"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078741"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078740"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078740"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078741"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078740"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-186"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078735"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a -&gt; b, s, w)
</span><a href="#local-6989586621679078735"><span class="hs-identifier hs-var">mf</span></a></span></span><span> </span><span id="local-6989586621679078734"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b.
RWST r w s m (a -&gt; b) -&gt; RWST r w s m a -&gt; RWST r w s m b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078733"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078733"><span class="hs-identifier hs-var">mx</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078732"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078732"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078731"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078731"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-187"></span><span>        </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078730"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679078730"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078729"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078729"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078728"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078728"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a -&gt; b, s, w)
</span><a href="#local-6989586621679078735"><span class="hs-identifier hs-var">mf</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078732"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078731"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078727"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078727"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078726"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078726"><span class="hs-identifier hs-var">s''</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679078725"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078725"><span class="hs-identifier hs-var">w'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078733"><span class="hs-identifier hs-var">mx</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078732"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078729"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-189"></span><span>        </span><span class="annot"><span class="annottext">(b, s, w) -&gt; m (b, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679078730"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078727"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078726"><span class="hs-identifier hs-var">s''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078728"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078725"><span class="hs-identifier hs-var">w'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span id="local-6989586621679079127"><span id="local-6989586621679079128"><span id="local-6989586621679079129"><span id="local-6989586621679079130"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679078717"><span id="local-6989586621679078719"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079130"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079129"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079129"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079128"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079130"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079127"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079129"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-193"></span><span>    </span><span id="local-6989586621679078714"><span class="annot"><span class="annottext">empty :: forall a. RWST r w s m a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w)
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-195"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078710"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078710"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078709"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. RWST r w s m a -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078707"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078707"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078706"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078706"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078705"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078705"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078710"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078706"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078705"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-operator hs-var">`mplus`</span></a></span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078707"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078706"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078705"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-196"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;|&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span id="local-6989586621679079115"><span id="local-6989586621679079116"><span id="local-6989586621679079117"><span id="local-6989586621679079118"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679078697"><span id="local-6989586621679078699"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079118"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079117"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079116"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079118"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079115"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079117"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,8,0))
</span><span>    </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">RWST</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">a</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">s</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">mempty</span><span class="hs-special">)</span><span>
</span><span id="line-201"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">return</span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#endif
</span><span>    </span><span id="local-6989586621679078691"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078691"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078690"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b.
RWST r w s m a -&gt; (a -&gt; RWST r w s m b) -&gt; RWST r w s m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679078689"><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679078689"><span class="hs-identifier hs-var">k</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078688"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078688"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078687"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078687"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078686"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078686"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078685"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078685"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078684"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078684"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078691"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078688"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078687"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078683"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679078683"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078682"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078682"><span class="hs-identifier hs-var">s''</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679078681"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078681"><span class="hs-identifier hs-var">w'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679078689"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078686"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078688"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078685"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-206"></span><span>        </span><span class="annot"><span class="annottext">(b, s, w) -&gt; m (b, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679078683"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078682"><span class="hs-identifier hs-var">s''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078684"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078681"><span class="hs-identifier hs-var">w'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,13,0))
</span><span>    </span><span class="hs-identifier">fail</span><span> </span><span class="hs-identifier">msg</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">RWST</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">fail</span><span> </span><span class="hs-identifier">msg</span><span>
</span><span id="line-210"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">fail</span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if MIN_VERSION_base(4,9,0)
</span><span id="local-6989586621679079103"><span id="local-6989586621679079104"><span id="local-6989586621679079105"><span id="local-6989586621679079106"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079106"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">Fail.MonadFail</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079105"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">Fail.MonadFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079104"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079106"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079103"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079105"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-215"></span><span>    </span><span id="local-6989586621679078670"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; RWST r w s m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span id="local-6989586621679078669"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679078669"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">Fail.fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679078669"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-216"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-pragma hs-type">fail</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-219"></span><span id="local-6989586621679079094"><span id="local-6989586621679079095"><span id="local-6989586621679079096"><span id="local-6989586621679079097"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079097"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079096"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079095"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079097"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079094"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079096"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-220"></span><span>    </span><span id="local-6989586621679078651"><span class="annot"><span class="annottext">mzero :: forall a. RWST r w s m a
</span><a href="#local-6989586621679078651"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w)
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-221"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-pragma hs-type">mzero</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-222"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078649"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078649"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078648"><span class="annot"><span class="annottext">mplus :: forall a. RWST r w s m a -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679078648"><span class="hs-operator hs-var hs-var hs-var hs-var">`mplus`</span></a></span></span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span id="local-6989586621679078647"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078647"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078646"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078646"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078645"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078645"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078649"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078646"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078645"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-operator hs-var">`mplus`</span></a></span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679078647"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078646"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078645"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-223"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-pragma hs-type">mplus</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span id="local-6989586621679079082"><span id="local-6989586621679079083"><span id="local-6989586621679079084"><span id="local-6989586621679079085"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079085"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#MonadFix"><span class="hs-identifier hs-type">MonadFix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079084"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#MonadFix"><span class="hs-identifier hs-type">MonadFix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079083"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079085"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079082"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079084"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-226"></span><span>    </span><span id="local-6989586621679078634"><span class="annot"><span class="annottext">mfix :: forall a. (a -&gt; RWST r w s m a) -&gt; RWST r w s m a
</span><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var hs-var hs-var hs-var">mfix</span></a></span></span><span> </span><span id="local-6989586621679078633"><span class="annot"><span class="annottext">a -&gt; RWST r w s m a
</span><a href="#local-6989586621679078633"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078632"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078632"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078631"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078631"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((a, s, w) -&gt; m (a, s, w)) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. MonadFix m =&gt; (a -&gt; m a) -&gt; m a
</span><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var">mfix</span></a></span><span> </span><span class="annot"><span class="annottext">(((a, s, w) -&gt; m (a, s, w)) -&gt; m (a, s, w))
-&gt; ((a, s, w) -&gt; m (a, s, w)) -&gt; m (a, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078630"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078630"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; RWST r w s m a
</span><a href="#local-6989586621679078633"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078630"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078632"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078631"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-pragma hs-type">mfix</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span id="local-6989586621679079071"><span id="local-6989586621679079072"><span id="local-6989586621679079073"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079073"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Class.html#MonadTrans"><span class="hs-identifier hs-type">MonadTrans</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079072"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079073"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079071"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-230"></span><span>    </span><span id="local-6989586621679078621"><span class="annot"><span class="annottext">lift :: forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var hs-var hs-var hs-var">lift</span></a></span></span><span> </span><span id="local-6989586621679078619"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679078619"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078618"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078618"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-231"></span><span>        </span><span id="local-6989586621679078617"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078617"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679078619"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-232"></span><span>        </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078617"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078618"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Class.html#lift"><span class="hs-pragma hs-type">lift</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span id="local-6989586621679079058"><span id="local-6989586621679079059"><span id="local-6989586621679079060"><span id="local-6989586621679079061"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079061"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079060"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079059"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079061"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079058"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079060"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-236"></span><span>    </span><span id="local-6989586621679078604"><span class="annot"><span class="annottext">liftIO :: forall a. IO a -&gt; RWST r w s m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; RWST r w s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; RWST r w s m a) -&gt; (IO a -&gt; m a) -&gt; IO a -&gt; RWST r w s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span>
</span><span id="line-237"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-pragma hs-type">liftIO</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span class="hs-cpp">

#if MIN_VERSION_base(4,12,0)
</span><span id="local-6989586621679079048"><span id="local-6989586621679079049"><span id="local-6989586621679079050"><span id="local-6989586621679079051"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679078600"><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079051"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079050"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079049"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079048"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079051"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-241"></span><span>    </span><span id="local-6989586621679078597"><span class="annot"><span class="annottext">contramap :: forall a' a. (a' -&gt; a) -&gt; RWST r w s m a -&gt; RWST r w s m a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var hs-var hs-var hs-var">contramap</span></a></span></span><span> </span><span id="local-6989586621679078595"><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679078595"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078594"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078594"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a', s, w)) -&gt; RWST r w s m a'
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a', s, w)) -&gt; RWST r w s m a')
-&gt; (r -&gt; s -&gt; m (a', s, w)) -&gt; RWST r w s m a'
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679078593"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078593"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078592"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078592"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-242"></span><span>      </span><span class="annot"><span class="annottext">((a', s, w) -&gt; (a, s, w)) -&gt; m (a, s, w) -&gt; m (a', s, w)
forall (f :: * -&gt; *) a' a.
Contravariant f =&gt;
(a' -&gt; a) -&gt; f a -&gt; f a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var">contramap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078591"><span class="annot"><span class="annottext">a'
</span><a href="#local-6989586621679078591"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078590"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078590"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078589"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078589"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679078595"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a'
</span><a href="#local-6989586621679078591"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078590"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078589"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (a', s, w)) -&gt; m (a, s, w) -&gt; m (a', s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078594"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078593"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078592"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-243"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-pragma hs-type">contramap</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-247"></span><span class="hs-comment">-- Reader operations</span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | Constructor for computations in the reader monad (equivalent to 'asks').</span><span>
</span><span id="line-250"></span><span id="local-6989586621679079041"><span id="local-6989586621679079042"><span id="local-6989586621679079043"><span id="local-6989586621679079044"><span id="local-6989586621679079045"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-identifier hs-type">reader</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079045"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079044"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079043"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079042"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079043"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079045"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079041"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079044"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079042"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-251"></span><span id="reader"><span class="annot"><span class="annottext">reader :: forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-identifier hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; RWST r w s m a
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#asks"><span class="hs-identifier hs-var">asks</span></a></span><span>
</span><span id="line-252"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-pragma hs-type">reader</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span class="hs-comment">-- | Fetch the value of the environment.</span><span>
</span><span id="line-255"></span><span id="local-6989586621679079032"><span id="local-6989586621679079033"><span id="local-6989586621679079034"><span id="local-6989586621679079035"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-identifier hs-type">ask</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079035"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079034"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079033"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079035"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079032"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079034"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079033"><span class="hs-identifier hs-type">r</span></a></span></span></span></span></span><span>
</span><span id="line-256"></span><span id="ask"><span class="annot"><span class="annottext">ask :: forall w (m :: * -&gt; *) r s. (Monoid w, Monad m) =&gt; RWST r w s m r
</span><a href="Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-identifier hs-var hs-var">ask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (r, s, w)) -&gt; RWST r w s m r
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (r, s, w)) -&gt; RWST r w s m r)
-&gt; (r -&gt; s -&gt; m (r, s, w)) -&gt; RWST r w s m r
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078580"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078580"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078579"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078579"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(r, s, w) -&gt; m (r, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078580"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078579"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-pragma hs-type">ask</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- | Execute a computation in a modified environment</span><span>
</span><span id="line-260"></span><span class="hs-comment">--</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- * @'runRWST' ('local' f m) r s = 'runRWST' m (f r) s@</span><span>
</span><span id="line-262"></span><span id="local-6989586621679079023"><span id="local-6989586621679079024"><span id="local-6989586621679079025"><span id="local-6989586621679079026"><span id="local-6989586621679079027"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-identifier hs-type">local</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079027"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079027"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079027"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079026"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079025"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079024"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079023"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079027"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079026"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079025"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079024"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079023"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-263"></span><span id="local"><span class="annot"><span class="annottext">local :: forall r w s (m :: * -&gt; *) a.
(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-identifier hs-var hs-var">local</span></a></span></span><span> </span><span id="local-6989586621679078578"><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679078578"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078577"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078577"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078576"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078576"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078575"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078575"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078577"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679078578"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078576"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078575"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-264"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-pragma hs-type">local</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span class="hs-comment">-- | Retrieve a function of the current environment.</span><span>
</span><span id="line-267"></span><span class="hs-comment">--</span><span>
</span><span id="line-268"></span><span class="hs-comment">-- * @'asks' f = 'liftM' f 'ask'@</span><span>
</span><span id="line-269"></span><span id="local-6989586621679078570"><span id="local-6989586621679078571"><span id="local-6989586621679078572"><span id="local-6989586621679078573"><span id="local-6989586621679078574"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#asks"><span class="hs-identifier hs-type">asks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078574"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078573"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078572"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078571"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078572"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078574"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078570"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078573"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078571"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-270"></span><span id="asks"><span class="annot"><span class="annottext">asks :: forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#asks"><span class="hs-identifier hs-var hs-var">asks</span></a></span></span><span> </span><span id="local-6989586621679078565"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679078565"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078564"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078564"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078563"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078563"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679078565"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078564"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078563"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#asks"><span class="hs-pragma hs-type">asks</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-274"></span><span class="hs-comment">-- Writer operations</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="hs-comment">-- | Construct a writer computation from a (result, output) pair.</span><span>
</span><span id="line-277"></span><span id="local-6989586621679079008"><span id="local-6989586621679079009"><span id="local-6989586621679079010"><span id="local-6989586621679079011"><span id="local-6989586621679079012"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#writer"><span class="hs-identifier hs-type">writer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079012"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679079011"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679079010"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079009"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079010"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079008"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079012"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079011"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-278"></span><span id="writer"><span class="annot"><span class="annottext">writer :: forall (m :: * -&gt; *) a w r s. Monad m =&gt; (a, w) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#writer"><span class="hs-identifier hs-var hs-var">writer</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679078560"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078560"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078559"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078559"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078558"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078558"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078560"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078558"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078559"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#writer"><span class="hs-pragma hs-type">writer</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="hs-comment">-- | @'tell' w@ is an action that produces the output @w@.</span><span>
</span><span id="line-282"></span><span id="local-6989586621679078999"><span id="local-6989586621679079000"><span id="local-6989586621679079001"><span id="local-6989586621679079002"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#tell"><span class="hs-identifier hs-type">tell</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079002"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679079001"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079000"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079001"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078999"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679079002"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-283"></span><span id="tell"><span class="annot"><span class="annottext">tell :: forall (m :: * -&gt; *) w r s. Monad m =&gt; w -&gt; RWST r w s m ()
</span><a href="Control.Monad.Trans.RWS.Lazy.html#tell"><span class="hs-identifier hs-var hs-var">tell</span></a></span></span><span> </span><span id="local-6989586621679078555"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078555"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ())
-&gt; (r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078554"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078554"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((), s, w) -&gt; m ((), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078554"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078555"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#tell"><span class="hs-pragma hs-type">tell</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="hs-comment">-- | @'listen' m@ is an action that executes the action @m@ and adds its</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- output to the value of the computation.</span><span>
</span><span id="line-288"></span><span class="hs-comment">--</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- * @'runRWST' ('listen' m) r s = 'liftM' (\\ (a, w) -&gt; ((a, w), w)) ('runRWST' m r s)@</span><span>
</span><span id="line-290"></span><span id="local-6989586621679078990"><span id="local-6989586621679078991"><span id="local-6989586621679078992"><span id="local-6989586621679078993"><span id="local-6989586621679078994"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listen"><span class="hs-identifier hs-type">listen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078994"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078993"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078992"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078991"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078994"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078990"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078993"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078992"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078991"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078994"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078990"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679078992"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-291"></span><span id="listen"><span class="annot"><span class="annottext">listen :: forall (m :: * -&gt; *) r w s a.
Monad m =&gt;
RWST r w s m a -&gt; RWST r w s m (a, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#listen"><span class="hs-identifier hs-var hs-var">listen</span></a></span></span><span> </span><span id="local-6989586621679078550"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078550"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((a, w), s, w)) -&gt; RWST r w s m (a, w)
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((a, w), s, w)) -&gt; RWST r w s m (a, w))
-&gt; (r -&gt; s -&gt; m ((a, w), s, w)) -&gt; RWST r w s m (a, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078549"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078549"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078548"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078548"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-292"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078547"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078547"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078546"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078546"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078545"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078545"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078550"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078549"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078548"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-293"></span><span>    </span><span class="annot"><span class="annottext">((a, w), s, w) -&gt; m ((a, w), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078547"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078545"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078546"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078545"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listen"><span class="hs-pragma hs-type">listen</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="hs-comment">-- | @'listens' f m@ is an action that executes the action @m@ and adds</span><span>
</span><span id="line-297"></span><span class="hs-comment">-- the result of applying @f@ to the output to the value of the computation.</span><span>
</span><span id="line-298"></span><span class="hs-comment">--</span><span>
</span><span id="line-299"></span><span class="hs-comment">-- * @'listens' f m = 'liftM' (id *** f) ('listen' m)@</span><span>
</span><span id="line-300"></span><span class="hs-comment">--</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- * @'runRWST' ('listens' f m) r s = 'liftM' (\\ (a, w) -&gt; ((a, f w), w)) ('runRWST' m r s)@</span><span>
</span><span id="line-302"></span><span id="local-6989586621679078979"><span id="local-6989586621679078980"><span id="local-6989586621679078981"><span id="local-6989586621679078982"><span id="local-6989586621679078983"><span id="local-6989586621679078984"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listens"><span class="hs-identifier hs-type">listens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078984"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078983"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078982"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078981"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078983"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078980"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078984"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078979"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078981"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078983"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078980"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078984"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078979"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679078982"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span>
</span><span id="line-303"></span><span id="listens"><span class="annot"><span class="annottext">listens :: forall (m :: * -&gt; *) w b r s a.
Monad m =&gt;
(w -&gt; b) -&gt; RWST r w s m a -&gt; RWST r w s m (a, b)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#listens"><span class="hs-identifier hs-var hs-var">listens</span></a></span></span><span> </span><span id="local-6989586621679078541"><span class="annot"><span class="annottext">w -&gt; b
</span><a href="#local-6989586621679078541"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078540"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078540"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((a, b), s, w)) -&gt; RWST r w s m (a, b)
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((a, b), s, w)) -&gt; RWST r w s m (a, b))
-&gt; (r -&gt; s -&gt; m ((a, b), s, w)) -&gt; RWST r w s m (a, b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078539"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078539"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078538"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078538"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-304"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078537"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078537"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078536"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078536"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078535"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078535"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078540"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078539"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078538"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-305"></span><span>    </span><span class="annot"><span class="annottext">((a, b), s, w) -&gt; m ((a, b), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078537"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; b
</span><a href="#local-6989586621679078541"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078535"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078536"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078535"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#listens"><span class="hs-pragma hs-type">listens</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- | @'pass' m@ is an action that executes the action @m@, which returns</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- a value and a function, and returns the value, applying the function</span><span>
</span><span id="line-310"></span><span class="hs-comment">-- to the output.</span><span>
</span><span id="line-311"></span><span class="hs-comment">--</span><span>
</span><span id="line-312"></span><span class="hs-comment">-- * @'runRWST' ('pass' m) r s = 'liftM' (\\ ((a, f), w) -&gt; (a, f w)) ('runRWST' m r s)@</span><span>
</span><span id="line-313"></span><span id="local-6989586621679078968"><span id="local-6989586621679078969"><span id="local-6989586621679078970"><span id="local-6989586621679078971"><span id="local-6989586621679078972"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#pass"><span class="hs-identifier hs-type">pass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078972"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078971"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078970"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078969"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078972"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078968"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679078970"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078970"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078971"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078970"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078969"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078972"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078968"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-314"></span><span id="pass"><span class="annot"><span class="annottext">pass :: forall (m :: * -&gt; *) r w s a.
Monad m =&gt;
RWST r w s m (a, w -&gt; w) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#pass"><span class="hs-identifier hs-var hs-var">pass</span></a></span></span><span> </span><span id="local-6989586621679078531"><span class="annot"><span class="annottext">RWST r w s m (a, w -&gt; w)
</span><a href="#local-6989586621679078531"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078530"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078530"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078529"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078529"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-315"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679078528"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078528"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078527"><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679078527"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078526"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078526"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078525"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078525"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m (a, w -&gt; w) -&gt; r -&gt; s -&gt; m ((a, w -&gt; w), s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m (a, w -&gt; w)
</span><a href="#local-6989586621679078531"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078530"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078529"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-316"></span><span>    </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078528"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078526"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679078527"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078525"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#pass"><span class="hs-pragma hs-type">pass</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="hs-comment">-- | @'censor' f m@ is an action that executes the action @m@ and</span><span>
</span><span id="line-320"></span><span class="hs-comment">-- applies the function @f@ to its output, leaving the return value</span><span>
</span><span id="line-321"></span><span class="hs-comment">-- unchanged.</span><span>
</span><span id="line-322"></span><span class="hs-comment">--</span><span>
</span><span id="line-323"></span><span class="hs-comment">-- * @'censor' f m = 'pass' ('liftM' (\\ x -&gt; (x,f)) m)@</span><span>
</span><span id="line-324"></span><span class="hs-comment">--</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- * @'runRWST' ('censor' f m) r s = 'liftM' (\\ (a, w) -&gt; (a, f w)) ('runRWST' m r s)@</span><span>
</span><span id="line-326"></span><span id="local-6989586621679078958"><span id="local-6989586621679078959"><span id="local-6989586621679078960"><span id="local-6989586621679078961"><span id="local-6989586621679078962"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#censor"><span class="hs-identifier hs-type">censor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078962"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078961"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078961"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078960"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078961"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078959"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078962"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078958"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078960"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078961"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078959"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078962"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078958"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-327"></span><span id="censor"><span class="annot"><span class="annottext">censor :: forall (m :: * -&gt; *) w r s a.
Monad m =&gt;
(w -&gt; w) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#censor"><span class="hs-identifier hs-var hs-var">censor</span></a></span></span><span> </span><span id="local-6989586621679078521"><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679078521"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679078520"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078520"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078519"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078519"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078518"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078518"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679078517"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078517"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078516"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078516"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679078515"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078515"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078520"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078519"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078518"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-329"></span><span>    </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078517"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078516"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679078521"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679078515"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#censor"><span class="hs-pragma hs-type">censor</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-333"></span><span class="hs-comment">-- State operations</span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span class="hs-comment">-- | Construct a state monad computation from a state transformer function.</span><span>
</span><span id="line-336"></span><span id="local-6989586621679078948"><span id="local-6989586621679078949"><span id="local-6989586621679078950"><span id="local-6989586621679078951"><span id="local-6989586621679078952"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#state"><span class="hs-identifier hs-type">state</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078952"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078951"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078950"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078949"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078950"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078948"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078952"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078950"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078951"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078949"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-337"></span><span id="state"><span class="annot"><span class="annottext">state :: forall w (m :: * -&gt; *) s a r.
(Monoid w, Monad m) =&gt;
(s -&gt; (a, s)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#state"><span class="hs-identifier hs-var hs-var">state</span></a></span></span><span> </span><span id="local-6989586621679078510"><span class="annot"><span class="annottext">s -&gt; (a, s)
</span><a href="#local-6989586621679078510"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078509"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078509"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679078508"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078508"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679078507"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078507"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; (a, s)
</span><a href="#local-6989586621679078510"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078509"><span class="hs-identifier hs-var">s</span></a></span><span>  </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078508"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078507"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#state"><span class="hs-pragma hs-type">state</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="hs-comment">-- | Fetch the current value of the state within the monad.</span><span>
</span><span id="line-341"></span><span id="local-6989586621679078939"><span id="local-6989586621679078940"><span id="local-6989586621679078941"><span id="local-6989586621679078942"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#get"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078942"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078941"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078940"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078942"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078939"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078941"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078939"><span class="hs-identifier hs-type">s</span></a></span></span></span></span></span><span>
</span><span id="line-342"></span><span id="get"><span class="annot"><span class="annottext">get :: forall w (m :: * -&gt; *) r s. (Monoid w, Monad m) =&gt; RWST r w s m s
</span><a href="Control.Monad.Trans.RWS.Lazy.html#get"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (s, s, w)) -&gt; RWST r w s m s
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (s, s, w)) -&gt; RWST r w s m s)
-&gt; (r -&gt; s -&gt; m (s, s, w)) -&gt; RWST r w s m s
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078502"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078502"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(s, s, w) -&gt; m (s, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078502"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078502"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#get"><span class="hs-pragma hs-type">get</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-comment">-- | @'put' s@ sets the state within the monad to @s@.</span><span>
</span><span id="line-346"></span><span id="local-6989586621679078931"><span id="local-6989586621679078932"><span id="local-6989586621679078933"><span id="local-6989586621679078934"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#put"><span class="hs-identifier hs-type">put</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078934"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078933"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078932"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078931"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078934"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078932"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078933"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-347"></span><span id="put"><span class="annot"><span class="annottext">put :: forall w (m :: * -&gt; *) s r.
(Monoid w, Monad m) =&gt;
s -&gt; RWST r w s m ()
</span><a href="Control.Monad.Trans.RWS.Lazy.html#put"><span class="hs-identifier hs-var hs-var">put</span></a></span></span><span> </span><span id="local-6989586621679078497"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078497"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ())
-&gt; (r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((), s, w) -&gt; m ((), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078497"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#put"><span class="hs-pragma hs-type">put</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- | @'modify' f@ is an action that updates the state to the result of</span><span>
</span><span id="line-351"></span><span class="hs-comment">-- applying @f@ to the current state.</span><span>
</span><span id="line-352"></span><span class="hs-comment">--</span><span>
</span><span id="line-353"></span><span class="hs-comment">-- * @'modify' f = 'get' &gt;&gt;= ('put' . f)@</span><span>
</span><span id="line-354"></span><span id="local-6989586621679078923"><span id="local-6989586621679078924"><span id="local-6989586621679078925"><span id="local-6989586621679078926"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#modify"><span class="hs-identifier hs-type">modify</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078926"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078925"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078924"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078924"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078923"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078926"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078924"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078925"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-355"></span><span id="modify"><span class="annot"><span class="annottext">modify :: forall w (m :: * -&gt; *) s r.
(Monoid w, Monad m) =&gt;
(s -&gt; s) -&gt; RWST r w s m ()
</span><a href="Control.Monad.Trans.RWS.Lazy.html#modify"><span class="hs-identifier hs-var hs-var">modify</span></a></span></span><span> </span><span id="local-6989586621679078492"><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621679078492"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ())
-&gt; (r -&gt; s -&gt; m ((), s, w)) -&gt; RWST r w s m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078491"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078491"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((), s, w) -&gt; m ((), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621679078492"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078491"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#modify"><span class="hs-pragma hs-type">modify</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">-- | Get a specific component of the state, using a projection function</span><span>
</span><span id="line-359"></span><span class="hs-comment">-- supplied.</span><span>
</span><span id="line-360"></span><span class="hs-comment">--</span><span>
</span><span id="line-361"></span><span class="hs-comment">-- * @'gets' f = 'liftM' f 'get'@</span><span>
</span><span id="line-362"></span><span id="local-6989586621679078914"><span id="local-6989586621679078915"><span id="local-6989586621679078916"><span id="local-6989586621679078917"><span id="local-6989586621679078918"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#gets"><span class="hs-identifier hs-type">gets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078918"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078917"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078916"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679078915"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078914"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078918"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078916"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078917"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078915"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-363"></span><span id="gets"><span class="annot"><span class="annottext">gets :: forall w (m :: * -&gt; *) s a r.
(Monoid w, Monad m) =&gt;
(s -&gt; a) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#gets"><span class="hs-identifier hs-var hs-var">gets</span></a></span></span><span> </span><span id="local-6989586621679078486"><span class="annot"><span class="annottext">s -&gt; a
</span><a href="#local-6989586621679078486"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078485"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078485"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (a, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; a
</span><a href="#local-6989586621679078486"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078485"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078485"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-364"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#gets"><span class="hs-pragma hs-type">gets</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="hs-comment">-- | Uniform lifting of a @callCC@ operation to the new monad.</span><span>
</span><span id="line-367"></span><span class="hs-comment">-- This version rolls back to the original state on entering the</span><span>
</span><span id="line-368"></span><span class="hs-comment">-- continuation.</span><span>
</span><span id="line-369"></span><span id="local-6989586621679078902"><span id="local-6989586621679078904"><span id="local-6989586621679078905"><span id="local-6989586621679078906"><span id="local-6989586621679078907"><span id="local-6989586621679078908"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC"><span class="hs-identifier hs-type">liftCallCC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078908"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-370"></span><span>    </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078907"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078906"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078905"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078908"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078904"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078905"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078908"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078902"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078908"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078905"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078907"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679078906"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078904"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-371"></span><span id="liftCallCC"><span class="annot"><span class="annottext">liftCallCC :: forall w (m :: * -&gt; *) a s b r.
Monoid w =&gt;
CallCC m (a, s, w) (b, s, w) -&gt; CallCC (RWST r w s m) a b
</span><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC"><span class="hs-identifier hs-var hs-var">liftCallCC</span></a></span></span><span> </span><span id="local-6989586621679078482"><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w)
</span><a href="#local-6989586621679078482"><span class="hs-identifier hs-var">callCC</span></a></span></span><span> </span><span id="local-6989586621679078481"><span class="annot"><span class="annottext">(a -&gt; RWST r w s m b) -&gt; RWST r w s m a
</span><a href="#local-6989586621679078481"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078480"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078480"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078479"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078479"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-372"></span><span>    </span><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w)
</span><a href="#local-6989586621679078482"><span class="hs-identifier hs-var">callCC</span></a></span><span> </span><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w) -&gt; CallCC m (a, s, w) (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078478"><span class="annot"><span class="annottext">(a, s, w) -&gt; m (b, s, w)
</span><a href="#local-6989586621679078478"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-373"></span><span>    </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; RWST r w s m b) -&gt; RWST r w s m a
</span><a href="#local-6989586621679078481"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078477"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078477"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (b, s, w)
</span><a href="#local-6989586621679078478"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078477"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078479"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078480"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078479"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-374"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC"><span class="hs-pragma hs-type">liftCallCC</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="hs-comment">-- | In-situ lifting of a @callCC@ operation to the new monad.</span><span>
</span><span id="line-377"></span><span class="hs-comment">-- This version uses the current state on entering the continuation.</span><span>
</span><span id="line-378"></span><span id="local-6989586621679078471"><span id="local-6989586621679078472"><span id="local-6989586621679078473"><span id="local-6989586621679078474"><span id="local-6989586621679078475"><span id="local-6989586621679078476"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC%27"><span class="hs-identifier hs-type">liftCallCC'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078476"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-379"></span><span>    </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078475"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078474"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078473"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078476"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078472"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078473"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078476"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078471"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078476"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078473"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078475"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679078474"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078472"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-380"></span><span id="liftCallCC%27"><span class="annot"><span class="annottext">liftCallCC' :: forall w (m :: * -&gt; *) a s b r.
Monoid w =&gt;
CallCC m (a, s, w) (b, s, w) -&gt; CallCC (RWST r w s m) a b
</span><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC%27"><span class="hs-identifier hs-var hs-var">liftCallCC'</span></a></span></span><span> </span><span id="local-6989586621679078468"><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w)
</span><a href="#local-6989586621679078468"><span class="hs-identifier hs-var">callCC</span></a></span></span><span> </span><span id="local-6989586621679078467"><span class="annot"><span class="annottext">(a -&gt; RWST r w s m b) -&gt; RWST r w s m a
</span><a href="#local-6989586621679078467"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078466"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078466"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078465"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078465"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-381"></span><span>    </span><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w)
</span><a href="#local-6989586621679078468"><span class="hs-identifier hs-var">callCC</span></a></span><span> </span><span class="annot"><span class="annottext">CallCC m (a, s, w) (b, s, w) -&gt; CallCC m (a, s, w) (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078464"><span class="annot"><span class="annottext">(a, s, w) -&gt; m (b, s, w)
</span><a href="#local-6989586621679078464"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-382"></span><span>    </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; RWST r w s m b) -&gt; RWST r w s m a
</span><a href="#local-6989586621679078467"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078463"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078463"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">r
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679078462"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078462"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, s, w) -&gt; m (b, s, w)
</span><a href="#local-6989586621679078464"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679078463"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078462"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078466"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078465"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-383"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCallCC%27"><span class="hs-pragma hs-type">liftCallCC'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span class="hs-comment">-- | Lift a @catchE@ operation to the new monad.</span><span>
</span><span id="line-386"></span><span id="local-6989586621679078883"><span id="local-6989586621679078885"><span id="local-6989586621679078886"><span id="local-6989586621679078887"><span id="local-6989586621679078888"><span id="local-6989586621679078889"><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCatch"><span class="hs-identifier hs-type">liftCatch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Catch"><span class="hs-identifier hs-type">Catch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078889"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078888"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679078887"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078886"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679078885"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Catch"><span class="hs-identifier hs-type">Catch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078889"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078883"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078885"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078886"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679078888"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679078887"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-387"></span><span id="liftCatch"><span class="annot"><span class="annottext">liftCatch :: forall e (m :: * -&gt; *) a s w r.
Catch e m (a, s, w) -&gt; Catch e (RWST r w s m) a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#liftCatch"><span class="hs-identifier hs-var hs-var">liftCatch</span></a></span></span><span> </span><span id="local-6989586621679078461"><span class="annot"><span class="annottext">Catch e m (a, s, w)
</span><a href="#local-6989586621679078461"><span class="hs-identifier hs-var">catchE</span></a></span></span><span> </span><span id="local-6989586621679078460"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078460"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679078459"><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679078459"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-388"></span><span>    </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078458"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078458"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679078457"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078457"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679078460"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078458"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078457"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s, w)
</span><a href="#local-6989586621679078461"><span class="hs-operator hs-var">`catchE`</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679078456"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679078456"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679078459"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679078456"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679078458"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679078457"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-389"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Trans.RWS.Lazy.html#liftCatch"><span class="hs-pragma hs-type">liftCatch</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-390"></span></pre></body></html>